{include file="public/headerbase" /} {include file="public/left" /}
<div class="right-content">
	<ol class="breadcrumb we7-breadcrumb">
		<li>
			<a href="{:url('Cate/index')}">业务范围</a>
		</li>
		<li>
			编辑信息
		</li>
	</ol>
	<div class="clearfix">
		{foreach name="data" item="val"}
		<form action="{:url('Cate/xiugai')}" methos="post" class="we7-form" role="form" id="form1" enctype="multipart/form-data">
			<div class="form-group">
				<label class="col-sm-2 control-label">业务名称</label>
				<div class="col-sm-8">
					<input type="text" class="form-control" name="cname" id="name" value="{$val['cname']}" placeholder="业务名称" />
				</div>
			</div>

			<div class="form-group">
				<div class="">
				<input type="hidden" name="cid" value="{$val.cid}" id="cid"/>
					<input type="submit" class="btn btn-primary" value="保存" />
				</div>
			</div>
		</form>
		{/foreach}
	</div>
	<script>
	$("#file0").change(function(){
	var objUrl = getObjectURL(this.files[0]) ;
	console.log("objUrl = "+objUrl) ;
	if (objUrl) {
		$("#img0").attr("src", objUrl) ;
	}
	}) ;
	//建立一個可存取到該file的url
	function getObjectURL(file) {
		var url = null ; 
		if (window.createObjectURL!=undefined) { // basic
			url = window.createObjectURL(file) ;
		} else if (window.URL!=undefined) { // mozilla(firefox)
			url = window.URL.createObjectURL(file) ;
		} else if (window.webkitURL!=undefined) { // webkit or chrome
			url = window.webkitURL.createObjectURL(file) ;
		}
		return url ;
	}
	</script>
</div>
</div>
</div>
</div>
</div>
{include file="public/footer" /}